class Solution(object):
    def mergeAlternately(self, word1, word2):
        n1 = len(word1)
        n2 = len(word2)
        index1 = 0
        index2 = 0
        t = ''
        while index1 < n1 and index2 < n2:
            t += word1[index1]
            t += word2[index2]
            index1 += 1
            index2 += 1
        if index1 < n1:
            t += word1[index1:]
        if index2 < n2:
            t += word2[index2:]
        return t